package com.example.nfc.server.bean;

/**
 * Create by 游德禄 on 2019-11-1
 */
public class PositionAttr {
    private int parentPosition = -1;
    private int childPosition = -1;

    public static PositionAttr set(int parentPosition){
        return new PositionAttr(parentPosition,-1);
    }
    public static PositionAttr set(int parentPosition,int childPosition){
        return new PositionAttr(parentPosition,childPosition);
    }
    //是否有子项
    public boolean hasChild(){
        return childPosition!=-1;
    }
    public PositionAttr(int parentPosition, int childPosition){
        this.parentPosition = parentPosition;
        this.childPosition = childPosition;
    }
    public int getParentPosition() {
        return parentPosition;
    }

    public void setParentPosition(int parentPosition) {
        this.parentPosition = parentPosition;
    }

    public int getChildPosition() {
        return childPosition;
    }

    public void setChildPosition(int childPosition) {
        this.childPosition = childPosition;
    }
}
